#ifndef __DEFAULT_SCENE_GRAPH_H__
#define __DEFAULT_SCENE_GRAPH_H__

#pragma once

#include "SceneGrpah.h"

namespace Nezha
{

		typedef DoubleLayersHashMap<SceneNode*, _string, DefStrDoubleHashFunctor> SceneNodeNameMap;
		typedef PArray<SceneNode*> SceneNodeArray;

		/** default scene graph implement. 
		TODO
			typical octree without occlusion culling queries intergrated?
		*/
		class DefaultSceneGraph : public SceneGraph
		{
		public:
			virtual SceneNode* findSceneNode(const _string& name);

			/**
			@REMARKS
				all its children will be destroyed.
			*/
			virtual void destroySceneNode(SceneNode* sn);

			virtual void update(float dt);

			///** Scene graph need push all the visible render objects to corresponding render queue.
			//	Lights that not overlapped with camera's frustum should be culled.
			//@remarks
			//	Currenlty we consider forward shading only.
			//*/
			//virtual void cull(RenderTarget* rt, RenderQueue* opaRq, RenderQueue* transRq);

			//DefaultSceneGraph();
		protected:
			virtual void _initialize();

			virtual SceneNode* createNodeImpl(const _string& name);

			virtual void _insertNode(SceneNode* sn);

			virtual void _destroyAllObjects();

			void recuDeleteChild(SceneNode* sn);

			//SceneNodeArray mSceneNodeGarbages;
			//SceneObjectArray mSceneObjectGarbages;
			SceneNodeNameMap mSceneNodes;
		};

}//end namespace Nezha

#endif //end __DEFAULT_SCENE_GRAPH_H__